/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Company: </p>
 *
 * @author 王校兵
 * @date 2016年7月19日
 */
package com.artpri.service.impl;

import com.artpri.dao.AdNewsDao;
import com.artpri.dao.IndexPagePictureDao;
import com.artpri.model.AdNews;
import com.artpri.model.AdPicture;
import com.artpri.service.IndexPagePictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 王校兵
 * @version 1.0
 * @date 2016年7月19日
 */
@Service
@Transactional
public class IndexPagePictureServiceImpl implements IndexPagePictureService {

	@Autowired
	private IndexPagePictureDao indexPagePictureDao;

	@Autowired
	private AdNewsDao adNewsDao;

	@Override
	@Transactional
	public List<AdPicture> getIndexPicture(String page, String fromPosition,
	                                       String toPosition) {

		//查询数据库中的指定位置的图片信息
		return indexPagePictureDao.getIndexPicture(page, fromPosition, toPosition);
	}

	@Override
	@Transactional
	public List getIndexPictureAndProduct(String page, String fromPosition,
	                                      String toPosition) {

		//查询数据库中的指定位置的图片信息和商品信息
		return indexPagePictureDao.getIndexPictureAndProduct(page, fromPosition, toPosition);
	}

	@Override
	public List<AdNews> getAppointNews(String page, String fromPosition,
	                                   String toPosition) {

		return adNewsDao.getAppointNews(page, fromPosition, toPosition);
	}

}
